package com.ice.work.moment.user.service.resource;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.honeybee.cloud.framework.common.page.Page;
import com.ice.work.moment.facade.user.dto.ResourceDTO;
import com.ice.work.moment.facade.user.model.Resource;
import com.ice.work.moment.facade.user.request.PageResourceRequest;

import java.util.Collection;
import java.util.List;

/**
 * @Description IResourceService
 * @Author DELL
 * @Create 2019-01-10
 * @Since 1.0.0
 */
public interface IResourceService {
    /**
     * 通过角色Id查询
     * @param roleId
     * @return
     */
    List<ResourceDTO> findByRoleId(Long roleId);
    /**
     * 通过角色Id批量查询
     * @param roleId
     * @return
     */
    List<ResourceDTO> findByRoleIds(Collection<Long> roleId);

    /**
     * 保存
     * @param resources
     * @return
     */
    Boolean  save(Collection<Resource> resources);

    /**
     * 保存
     * @param resources
     * @return
     */
    Boolean  saveOrUpdateBySign(Collection<Resource> resources);

    /**
     * 分页查询资源
     * @param page
     * @param resourceRequest
     * @return
     */
    Page<ResourceDTO> page(IPage<Resource> page, PageResourceRequest resourceRequest);

}
